const User = require('../lib/mongo').User;
module.exports = {
  // 注册一个用户
  create: function create(user) {
    return new Promise(function(reject, resolve) {
      User.create(user, function(err, ret) {
        if (err) {
          console.log('操作失败');
          reject(err);
        } else {
          console.log('操作成功');
          resolve(ret);
        }
      });
    });
  }
}